home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Copyright (C) 1995 Rolf Jakob <rjakob@duffy1.franken.de>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
- struct c_tokens_str {
- char token[16];
- int number;
- };
-
- #define C_CLS 1
- #define C_TERM 2
- #define C_REFRESH 3
- #define C_WAIT 4
- #define C_NOTERM 5
- #define C_EXIT 6
- #define C_GO_X 10
- #define C_GO_Y 11
- #define C_C_EOL 12
- #define C_C_BOT 13
- #define C_GOTO 14
- #define C_BOLD 28
- #define C_NOBOLD 29
- #define C_BLINK 30
- #define C_NOBLINK 31
- #define C_COLOROFF 32
- #define C_NORMAL 32
- #define C_FIRSTCOLOR 33
- #define C_BLACK 33
- #define C_RED 34
- #define C_GREEN 35
- #define C_BROWN 36
- #define C_BLUE 37
- #define C_MAGENTA 38
- #define C_CYAN 39
- #define C_LGRAY 40
- #define C_DGRAY 41
- #define C_LRED 42
- #define C_LGREEN 43
- #define C_YELLOW 44
- #define C_LBLUE 45
- #define C_LMAGENTA 46
- #define C_LCYAN 47
- #define C_WHITE 48
- #define C_LASTCOLOR 48
- #define C_BACKGROUND 49
- #define C_INVERS 50
- #define C_NOINVERS 51
- #define C_ENV 64
- #define C_LOGIN 65
- #define C_SYSTEM 66
- #define C_PIPE 67
- #define C_PPIPE 68
- #define C_OPIPE 69
- #define C_GETKEY 70
- #define C_OKEY 71
- #define C_GETSTR 72
- #define C_OSTR 73
- #define C_EXEC 74
- #define C_SET 75
- #define C_UNSET 76
- #define C_OSTRC 77
- #define C_OSTRI 78
- #define C_OPEN 80
- #define C_CLOSE 81
- #define C_REDIR 82
- #define C_UNREDIR 83
- #define C_IFEX 84
- #define C_IFTERM 85
- #define C_IOPEN 86
- #define C_ICLOSE 87
- #define C_IGETSTR 88
- #define C_APPEND 89
- #define C_IFEMPTY 90
- #define C_IFNEMPTY 91
- #define C_IFZERO 92
- #define C_IFNZERO 93
- #define C_IREWIND 94
- #define C_IFEQ 95
- #define C_IFNEQ 96
- #define C_IFGT 97
- #define C_IFNGT 98
- #define C_TRUNCR 99
- #define C_TRUNCL 100
- #define C_ADVANCE 101
- #define C_PAUSE 102
- #define C_INCLUDE 103
- #define C_SPAWN 104
-
- struct c_tokens_str c_tokens[]={
- "CLS",C_CLS, /* clear screen */
- "TERM",C_TERM, /* switch to "curses" mode */
- "R",C_REFRESH, /* refresh screen (a must in "curses" mode */
- "REFRESH",C_REFRESH, /* same as R */
- "exit",C_EXIT, /* quit showtext */
- "warte",C_WAIT, /* same as wait */
- "wait",C_WAIT, /* [wait text] wait for a return and optionally print text */
- "NOTERM",C_NOTERM, /* switch to normal terminal mode */
- "go_x",C_GO_X, /* [go_x x] goto hor. position x (only in TERM mode) */
- "go_y",C_GO_Y, /* [go_y y] goto vert. position y (only in TERM mode) */
- "c_eol",C_C_EOL, /* clear to end of line */
- "c_bot",C_C_BOT, /* clear to bottom of screen */
- "goto",C_GOTO, /* [goto label] jump to label */
- "blink",C_BLINK, /* set blink attribute */
- "noblink",C_NOBLINK, /* unset blink attribute */
- "bold",C_BOLD, /* set bold attribute */
- "nobold",C_NOBOLD, /* unset bold attribute */
- "normal",C_COLOROFF, /* switch off attributes - normal color */
- "black",C_BLACK, /* set foreground (fg) color to black */
- "red",C_RED, /* fg red */
- "green",C_GREEN, /* fg green */
- "brown",C_BROWN, /* fg brown */
- "blue",C_BLUE, /* fg blue */
- "magenta",C_MAGENTA, /* fg magenta */
- "cyan",C_CYAN, /* fg cyan */
- "lgray",C_LGRAY, /* fg light gray */
- "gray",C_LGRAY, /* same as lgray */
- "dgray",C_DGRAY, /* fg dark gray "light black" */
- "lred",C_LRED, /* fg light red */
- "lgreen",C_LGREEN, /* fg light green */
- "yellow",C_YELLOW, /* fg yellow "light brown" */
- "lblue",C_LBLUE, /* fg light blue */
- "lmagenta",C_LMAGENTA, /* fg light magenta */
- "lcyan",C_LCYAN, /* fg light cyan */
- "white",C_WHITE, /* fg white */
- "bg",C_BACKGROUND, /* [bg color] set background to color (see fg ..) */
- "invers",C_INVERS, /* set REVERSE attribute (kills color !) */
- "reverse",C_INVERS, /* same as invers */
- "noinvers",C_NOINVERS, /* unset REVERSE attribute */
- "noreverse",C_NOINVERS, /* same as noinvers */
- "login",C_LOGIN, /* prints out login name */
- "env",C_ENV, /* [env var] gets environment var and prints it */
- "system",C_SYSTEM, /* [system command] executes command */
- "exec",C_EXEC, /* [exec command] executes command (no return !) */
- "spawn",C_SPAWN, /* [spawn command] executes command in another process */
- "pipe",C_PIPE, /* [pipe command] executes command and stores output */
- "ppipe",C_PPIPE, /* [pipe command] same as pipe but prints output immediatly */
- "opipe",C_OPIPE, /* prints output from previous pipe command */
- "getkey",C_GETKEY, /* [getkey charlist] gets characters until it's in charlist */
- "okey",C_OKEY, /* prints character from previous getkey command */
- "getstr",C_GETSTR, /* [getstr length name] gets string into var name max. length length */
- "igetstr",C_IGETSTR, /* [igetstr name] gets string into var name */
- "ostr",C_OSTR, /* [ostr var] prints var */
- "ostrc",C_OSTRC, /* similar to ostr but centers output in term mode */
- "ostri",C_OSTRI, /* interprets arg (var substitution) and outputs the result */
- "open",C_OPEN, /* [open name] opens file name for output (clears existing file) */
- "append",C_APPEND, /* [append name] opens file name for appending */
- "iopen",C_IOPEN, /* [iopen name] opens file name for input */
- "close",C_CLOSE, /* closes file from previous open/append */
- "iclose",C_ICLOSE, /* closes file from previous iopen */
- "irewind",C_IREWIND, /* positions filepointer of input file to beginning */
- "redir",C_REDIR, /* redirect to file from previous open/append */
- "unredir",C_UNREDIR, /* redirect back to stdout */
- "set",C_SET, /* [set var value] set variable var to value (interprets $name) */
- "unset",C_UNSET, /* [unset var] unset variable */
- "truncr",C_TRUNCR, /* [truncr var] removes trailing spaces of value of var */
- "truncl",C_TRUNCL, /* [truncl var] removes leading spaces of value of var */
- "advance",C_ADVANCE, /* [advance var value] adds value to var */
- "ifexist",C_IFEX, /* [ifexist file] execute remainder of line if file exists */
- "ifterm",C_IFTERM, /* [ifterm type] dito if terminal type is type */
- "ifempty",C_IFEMPTY, /* [ifempty var] dito if var is empty */
- "ifnempty",C_IFNEMPTY, /* [ifnempty var] dito if var is not empty */
- "ifzero",C_IFZERO, /* [ifzero var] dito if var is 0 */
- "ifnzero",C_IFNZERO, /* [ifnzero var] dito if var is not 0 */
- "ifeq",C_IFEQ, /* [ifeq var value] dito if var is value */
- "ifneq",C_IFNEQ, /* [ifneq var value] dito if var is not value */
- "ifgt",C_IFGT, /* [ifgt var value] dito if var is greater value (num.) */
- "ifngt",C_IFNGT, /* [ifngt var value] dito if var is not greater value (num.) */
- "pause",C_PAUSE, /* [pause number] executes wait if less than number lines left */
- "include",C_INCLUDE, /* [include file] includes file into current source */
- "NOP",0}; /* only for internal use :-) */
-
-